
#pragma once

#include "Widget.h"
#include "Panel.h"
#include "Button.h"

#include "../TypedList.h"

template <class MB_Menu> class TypedList;
class MB_Menu;
class DialogPanel;

class MenuBar : public Panel
{
	public:

		MenuBar( Widget* pxParent );
		virtual ~MenuBar();

		virtual void Update();

		virtual FHandle AddMenu( const char* szName );
		virtual void AddMenuItem( FHandle iMenuHandle, const char* szName, ButtonPressCallback pfnCallback, void* pUserData );
		virtual void AddDivider( FHandle iMenuHandle );

	protected:

		static void MenuTitleClickCallback( void* pData );
		static void MenuItemClickCallback( void* pData );
		
		void CloseOpenMenu();

		bool m_bCloseOpenMenuNextFrame;

		static DialogPanel* s_pxOpenMenu;
		static FHandle s_iOpenMenuHandle;

		bool CanGetFocus() { return false; }
};

//eof